
module.exports = function () {
    this.all('/api/v1/getType', async ctx => {
        console.log(ctx.request.href);
        const apks = ctx.query.apks || ctx.request.body.apks;
        const list = apks.split(',').filter(el => !!el).map(el => {
            return {
                package: el,
                type: 0,
            };
        });

        ctx.type = 'text/html;charset=UTF-8';
        ctx.body = JSON.stringify({
            listing: list,
            status: 'OK',
        })
    });
}